Skip to content

[codex] Add runtime abstraction and cc-connect provider#1103

Draft
ashione wants to merge 77 commits into
ValueCell-ai:mainfrom
ashione:feature/runtime-abstraction-cc-connect
Draft

[codex] Add runtime abstraction and cc-connect provider#1103
ashione wants to merge 77 commits into
ValueCell-ai:mainfrom
ashione:feature/runtime-abstraction-cc-connect

Conversation

@ashione

@ashione ashione commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a runtime abstraction layer for ClawX so OpenClaw remains the default runtime while cc-connect can be selected as an optional packaged runtime.

This update completes the cc-connect replacement slice:

  • Bundles both cc-connect and native OpenAI Codex CLI artifacts into app resources; runtime startup no longer depends on global installs, PATH binaries, node_modules postinstall binaries, or app-time downloads.
  • Starts a real ClawX-managed cc-connect process with management and bridge enabled in app.getPath('userData')/runtimes/cc-connect/config.toml.
  • Routes GUI chat through a ClawX cc-connect BridgePlatform adapter and maps replies back to existing chat:message / chat:runtime-event Host events.
  • Keeps OpenAI API key, OpenAI OAuth/Codex, and Ollama provider/model profile sync under the managed cc-connect/Codex home.
  • Routes cron Host APIs to cc-connect Management API when cc-connect is active.
  • Mirrors enabled local skills into the managed Codex home for cc-connect mode.
  • Updates Settings capability flags, docs, README files, packaging scripts, and E2E coverage.

Validation

  • pnpm run typecheck:node
  • pnpm run typecheck:web
  • pnpm exec vitest run tests/unit/cc-connect-runtime-provider.test.ts tests/unit/cc-connect-paths.test.ts tests/unit/codex-paths.test.ts tests/unit/codex-bundle.test.ts tests/unit/cc-connect-skills.test.ts tests/unit/host-services.test.ts tests/unit/runtime-manager.test.ts tests/unit/codex-cli-bridge.test.ts
  • pnpm run bundle:cc-connect:current && pnpm run bundle:codex:current
  • pnpm run comms:replay && pnpm run comms:compare
  • pnpm run build:vite && pnpm exec playwright test tests/e2e/cc-connect-codex-runtime.spec.ts tests/e2e/settings-runtime-selector.spec.ts
  • pnpm exec eslint electron/main/ipc-handlers.ts electron/runtime/cc-connect-bridge-adapter.ts electron/runtime/cc-connect-paths.ts electron/runtime/cc-connect-provider.ts electron/runtime/cc-connect-skills.ts electron/runtime/codex-paths.ts electron/runtime/codex-cli-bridge.ts electron/runtime/types.ts electron/services/cron-api.ts electron/services/skills-api.ts scripts/bundle-codex.mjs scripts/codex-bundle-lib.mjs tests/e2e/cc-connect-codex-runtime.spec.ts tests/unit/cc-connect-paths.test.ts tests/unit/cc-connect-runtime-provider.test.ts tests/unit/cc-connect-skills.test.ts tests/unit/codex-bundle.test.ts tests/unit/codex-paths.test.ts tests/unit/host-services.test.ts tests/fixtures/codex-bundle-api.ts
  • git diff --check
  • build/cc-connect/darwin-arm64/cc-connect --version
  • build/codex/darwin-arm64/bin/codex --version

Note: local full pnpm run lint:check still fails only because this checkout contains nested .claude/worktrees/... directories with unrelated lint errors outside the PR diff. The scoped lint command above covers the files changed by this PR and passes.

Remaining Notes

  • OpenClaw remains the default runtime and rollback path.
  • cc-connect mode now reports chat/session/history/provider/model/cron/skills as supported; channel-specific OpenClaw controls remain unavailable in cc-connect mode.

@ashione
ashione requested a review from su8su June 7, 2026 15:48
@ashione
ashione requested review from hazeone and vcfgv June 8, 2026 12:29
@ashione
ashione force-pushed the feature/runtime-abstraction-cc-connect branch from 75a8efd to a504a8c Compare June 9, 2026 12:12
zuolingxuan and others added 9 commits June 9, 2026 20:21
…action-cc-connect

# Conflicts:
#	electron/services/providers-api.ts
#	package.json
#	pnpm-lock.yaml
Add operation-level runtime capabilities so cc-connect can report native, proxy, and unsupported sub-operations without overstating OpenClaw parity.

Keep OpenClaw as the default runtime, surface cc-connect operation gaps in Settings, and extend OAuth/bundle E2E coverage plus harness specs for replacement-readiness validation.
Send GUI chat through the Codex bridge so cc-connect runtime sessions use Codex as the execution engine.

Persist Codex JSONL tool call and tool output events as ClawX history messages so the chat execution graph can show command/tool relationships.
Default cc-connect Codex execution to ClawX-managed runtime workspaces under userData instead of the ClawX source checkout.

Map OpenClaw agent ids to cc-connect managed workspace directories without inheriting OpenClaw workspace paths, while preserving explicit workDir overrides for diagnostics.
ashione added 30 commits July 12, 2026 08:53
Require the real Feishu admin fixture before launch and classify exit-zero test commands with no passing tests as skipped. Record why the unreleased cc-connect usage observer does not yet satisfy the runtime token contract.
Keep GitHub and OSS publication tag-only while allowing unsigned workflow-dispatch builds to exercise all five packaged runtime smoke targets.
Pass archive paths directly to tar so Windows runner paths are not shell-escaped. Keep macOS signature verification mandatory by default while allowing explicit unsigned manual smoke evidence.
Keep OAuth acquisition runtime-neutral, synchronize the resulting account through the selected RuntimeProvider, and avoid restarting OpenClaw while cc-connect is active. Preserve the existing OpenClaw projection fallback and surface runtime projection failures to the OAuth flow.
Give newly acquired browser OAuth credentials one-time precedence when syncing cc-connect, while keeping ordinary runtime starts managed-first so Codex token rotation is preserved. Add Electron runtime recovery coverage and machine-readable verifier evidence.
Treat undeclared operations as unsupported after runtime status publishes its operation map, and stop cc-connect-only channel gaps before RPC. Add replacement-required unit and real-bundle verifier evidence.
Route real image, file, audio, and video packets from bundled cc-connect through managed history and GUI Chat. Preserve distinct same-run events, keep runtime media visible beside execution graphs, and add real CLI evidence plus verifier coverage.
Render initial text previews, route handle-only updates across concurrent agents, and clear transient text without discarding structured tool state.\n\nAdd real bundled cc-connect preview/update GUI evidence and keep unsupported upstream delete/button triggers explicit in the validation matrix.
Map public Bridge cards and select options into validated runtime interactions, then return responses through card_action without bypassing cc-connect. Add real bundled Electron evidence for the /lang choice loop and document the v1.4.1 persistence boundary.
Exercise real cc-connect exec and Codex OAuth prompt jobs on native scheduler ticks. Record sanitized UI and machine evidence, preserve runtime PID, and require successful deletion plus post-delete absence.
Mask managed workspace paths in real OAuth screenshots and replace repository, home, and temp roots before persisting local-real reports. Preserve approval, tool lifecycle, generated-file, and retry evidence.
Map the pinned runtime's last_run and last_error fields into the shared Cron contract instead of treating trigger acknowledgement as completion. Make the real OAuth Cron scenario wait for runtime completion before asserting public history and attach bounded diagnostics on failure.
Keep Run Now acknowledgement non-blocking while observing the runtime-owned job until its last run changes or a bounded cancellation condition occurs. Cover delayed success and failure in deterministic Electron tests and the real cc-connect OAuth GUI flow.
Launch Electron with isolated legacy and shared roots to verify startup migration, directory ownership, source retention, and canonical-state precedence across relaunches. Keep the existing flat E2E userData override as the default for all other tests.
Verify real cc-connect channel import keeps OpenClaw compatibility data read-only, stores secrets only in the encrypted vault, and emits sanitized ownership evidence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant